import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router';
import { getStore, removeStore } from '@/utils/utils';
import i18n from '@/lang/index';

const router = createRouter({
    history: createWebHashHistory(import.meta.env.BASE_URL),

    routes: [
        {
            path: '/layout',
            name: 'layout',
            component: () => import('@/views/layout/index.vue'),
            children: [
                {
                    path: '/',
                    name: 'home',
                    component: () => import('@/views/home/index.vue'),
                },
                {
                    path: '/solution',
                    name: 'solution',
                    component: () => import('@/views/solution/index.vue'),
                },
                {
                    path: '/download',
                    name: 'download',
                    component: () => import('@/views/download/index.vue'),
                },
                {
                    path: '/contact',
                    name: 'contact',
                    component: () => import('@/views/contact/index.vue'),
                },
            ],
        },
    ],
    //滚动行为
    scrollBehavior() {
        return {
            left: 0,
            top: 0,
        };
    },
});

router.afterEach((to, from) => {});

router.beforeEach((to, from, next) => {
    next();
});

export default router;
